package com.example.weli.ble2test;

import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

import java.io.IOException;

public class SensorTypeAdapter extends TypeAdapter<NewBean> {
    @Override
    public void write(JsonWriter out, NewBean v1) throws IOException {
        out.beginObject();
        //按自定义顺序输出字段信息
        out.name("c").value(v1.c);
        out.name("l").value(v1.l);
        out.name("ll").jsonValue(v1.ll.toString());
        out.endObject();
    }

    @Override
    public NewBean read(JsonReader in) throws IOException {
        return null;
    }


}
